﻿using ACC.Business;
using ACC.Business.Stn;
using ACC.Data;
using ACC.Data.ACCLog;
using ACC.Data.Comm;
using ACC.Data.Entities.Mes;
using ACC.Data.Line;
using ACC.Device;
using ACC.LineDevice.KukaPack;
using System;
using System.Collections.Generic;
using System.Linq;


namespace Script
{
    /// <summary>
    /// 绝缘板等离子清洗
    /// OP L1M02040, STATION L1M12041, L1M22041
    /// </summary>
    public class L1M02040 : StnProcessPL02_DX
    {
        public L1M02040(StnRunningData data)
            : base(data)
        {
            IsReport = false;
            IsACCReport = false;
            IsPalletRelationSN = false;
        }

        protected override ACCDevice CreateDevice()
        {
            ACCDevice dev = base.CreateDevice();
            if (kukaSiemensDev != null)
            {
                kukaSiemensDev.DB190 = 800;
                kukaSiemensDev.DB190_Offset = 4000;
                kukaSiemensDev.DB192 = 80;
                kukaSiemensDev.DB192_PLC_Offset = 4290;

                kukaSiemensDev.DB193 = 800;
                kukaSiemensDev.DB193_PLC_Offset = 4034;
                kukaSiemensDev.DB193_ACC_Offset = 4068;
                kukaSiemensDev.DB194 = 800;
                kukaSiemensDev.DB194_PLC_Offset = 4034;
                kukaSiemensDev.DB194_PLC_Data_Offset = 4302;

                kukaSiemensDev.BarcodeLength = 30;
                kukaSiemensDev.LoadBarcodeCount = 2;
                kukaSiemensDev.UnloadBarcodeCount = 2;

                kukaSiemensDev.Material_COMM_Offset = 292;       // 上下料信号位偏移量
            }

            return dev;

        }

        protected override void CreateBusinessLogic()
        {
            base.CreateBusinessLogic();

            (_loadProcess as LoadProcess_DX).R = 3;
            (_unloadProcess as UnloadProcess_DX).R = 3;
            (_unloadProcess as UnloadProcess_DX).OneAsNG = true;
        }
    }
}